package com.konne.nightmare.FastPublicOpinion.mvp.model.impl;


import com.konne.nightmare.FastPublicOpinion.base.OnLoadDataListener;
import com.konne.nightmare.FastPublicOpinion.bean.UserInfoBean;
import com.konne.nightmare.FastPublicOpinion.http.BaseObserver;
import com.konne.nightmare.FastPublicOpinion.http.BaseResponse;
import com.konne.nightmare.FastPublicOpinion.http.RetrofitFactory;
import com.konne.nightmare.FastPublicOpinion.mvp.model.IHomeFragmentModel;
import com.konne.nightmare.FastPublicOpinion.mvp.model.IUserFragmentModel;


public class UserFragmentModelImpl implements IUserFragmentModel {
    @Override
    public void getInfo( OnLoadDataListener<UserInfoBean.DataBean> onLoadDataListener) {
        RetrofitFactory.getInstance().getInfo( new BaseObserver<UserInfoBean.DataBean>() {
            @Override
            protected void onSuccess(BaseResponse<UserInfoBean.DataBean> t) throws Exception {
                onLoadDataListener.onSuccess(t);
            }

            @Override
            protected void onFailure(String error, boolean isNetWorkError) throws Exception {
                onLoadDataListener.onFailure(error);
            }
        });
    }
}
